package com.example.restaurantfinder;

import com.example.restaurantfinder.config.Configuration;
import com.example.restaurantfinder.maps.MapActivity;
import com.example.restaurantfinder.model.RestaurantList;
import com.example.restaurantfinder.utils.Processor;

import android.os.AsyncTask;
import android.os.Bundle;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ListView;

public class MainActivity extends Activity {
	
	private RestaurantList myPlaces = new RestaurantList();
	private ListView lv;
	private Button btnShowOnMap;

	 
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		ImageButton ib = (ImageButton) findViewById(R.id.restFindBtn);
	    ib.setOnClickListener(new View.OnClickListener() {
	        @Override
	        public void onClick(View v) {
	        	Intent myIntent = new Intent(MainActivity.this, MapActivity.class);
	        	MainActivity.this.startActivity(myIntent);
	        }
	    });
	    
	    
	 // Getting listview
        lv = (ListView) findViewById(R.id.list);
 
        ImageButton ib1 = (ImageButton) findViewById(R.id.cuisineRestFindBtn);
	    ib1.setOnClickListener(new View.OnClickListener() {
	        @Override
	        public void onClick(View v) {
//	        	GetPlaces getPlaces = new GetPlaces();
//	       	 	getPlaces.applicationContext = MainActivity.this;
//	       	    getPlaces.execute();
	        	Intent intent = new Intent(getParent(), MapActivity.class);
	        	startActivity(intent);
	        	
	        }
	    });
        
	}
	
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}
	
	
}
